package com.chenliang.nacos.biz;

import com.chenliang.nacos.service.NacosService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @program: springcloud_all
 * @description:
 * @author: 陈亮
 * @create: 2022-04-03 15:17
 */
@RestController
@RequestMapping("/nacos8083")
public class NacosBiz {


    @Autowired
    private RestTemplate restTemplate;

    @Autowired
    private NacosService nacosService;

    @GetMapping("/getInfo1")
    public String getInfo() {
        return restTemplate.getForObject("http://nacos-8082/nacos8082/getInfo", String.class);
    }

    @GetMapping("/getInfo2")
    public String getInfo2() {
        return nacosService.getInfo();
    }
}
